<%--
 *  File:    SalesHistoryPop.jsp
 *  @Author: TendyHu 
 *  Date:    2010/09/27
 *
 *  Copyright (C) 2000 - 2010 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>



<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java"%>
<%@ page import="java.util.*"%>
<%@ page import="org.apache.log4j.Category"%>

<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval"%>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom"%>

<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.SalesHistoryPop");  
%>

<% //--------------------------------------  variant and initialization --%>
<%
	String strModuleName = "UPM";
  	String strTableName = "v_historywatchlog";
    String contextPath = request.getContextPath();
	
%>
<%
  	//get current userinfo
  	HashMap CurUserInfo = (HashMap)session.getAttribute("userinfo");
  	Integer nCurOrgId = (Integer)CurUserInfo.get("orgid");
  	Integer nCurUserId = (Integer)CurUserInfo.get("userid");
  	
%>

<% //--------------------------------------  include files list --%>
<%@ include file="/inc/PageDefault.inc"%>
<%@ include file="/inc/LocationDefault.inc"%>


<html>
<head>
<title>UserSelectPop</title>
<PageFlow:CheckPageFlow pageName="p_historywatchlog" />
<%@ include file="/inc/InitEdit.inc"%>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css"
	type="text/css">
<script language="JavaScript"
	src="<%=contextPath %>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/FuncLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc"%>

<% //--------------------------------------  output variant from pageflow --%>
<%
  	Integer nOrgId = (Integer)pageContext.getAttribute("orgid");
  	Vector userparentlogsummary = (Vector)pageContext.getAttribute("userparentlogsummary");
  	if(userparentlogsummary == null)
    	userparentlogsummary = new Vector();
%>
<script>

function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(userparentlogsummaryform,actionvalue,orderbyname);
  editform.action = "SalesHistoryPop.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();  
}

function page_finish()
{   var id =userparentlogsummaryform.userid.value;
    var name = userparentlogsummaryform.username.value;
    var employeename = userparentlogsummaryform.employeename.value;
    opener.page_setUser(id,name,employeename);
    window.close();
}
function page_cancel()
{
    window.close();
}
</script>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<% //--------------------------------------  hidden form variant --%>
<form name="userparentlogsummaryform" method="post"
	action="../../Dispatcher" target="_parent"><input type="hidden"
	name="pagename" value="userparentlogsummary"> <input type="hidden"
	name="actionname"> <custom:hidden property="userid" /> <% //--------------------------------------  page location --%>


<table width="100%" cellspacing="0" cellpadding="0" border="0">
	<tr>
		<td valign="top">
		<table width="100%" border="0" cellspacing="0">
			<tr>
				<td class="summary_top"></td>
			</tr>
		</table>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<td>
			<table>
				<%@ include file="/inc/SummarySearch.inc"%>
			</table>
			</td>
		</table>

		<table border="1" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" width="100%" cellpadding="0">

			<% //--------------------------------------  summary header --%>
			<tr bgcolor="#ACBCCA" class="deepblue-left">
				<td width="5%" class="title_center">&nbsp;</td>
				<td width="16%" class="title_center"><a
					href="javascript:page_summary('orderby','userid')"><%= label.getLabelName("L_UserID") %></a></td>
				<td width="10%" class="title_center"><a
					href="javascript:page_summary('orderby','oldparentuserid')"><%= label.getLabelName("L_OldParentUserID") %></a></td>
				<td width="14%" class="title_center"><a
					href="javascript:page_summary('orderby','newparentuserid')"><%= label.getLabelName("L_NewParentUserID") %></a></td>
				<td width="15%" class="title_center"><a
					href="javascript:page_summary('orderby','maker')"><%= label.getLabelName("L_Maker") %></a></td>
				<td class="title_center"><a
					href="javascript:page_summary('orderby','executetime')"><%= label.getLabelName("L_ExecuteTime") %></a></td>				
			</tr>

			<% //--------------------------------------  default value definition --%>
			<%
        	int i = 0;
            String strClassType = new String();   
            Integer nDefaultUserId = new Integer(-1);            
            boolean bHasChecked = false;             
      	%>

			<% //--------------------------------------  loop results --%>
			<logic:iterate id="usersum" collection="<%= userparentlogsummary %>">
				<%
        	HashMap userMap = (HashMap)pageContext.getAttribute("usersum");            
          
            String strIsDisabled = new String("");
            String strIsChecked = new String("");
            if(i%2 == 1)
            {
              	strClassType = "td-listrom";
            }else{                    
              	strClassType = "";
            }           
            i++;                         
          %>

				<tr onMouseOver="this.className='tr-over'"
					onMouseOut="this.className='<%=JspHelper.filterNull( strClassType )%>'"					
					class="<%=JspHelper.filterNull( strClassType )%>">
					<td width="5%" class="<%=JspHelper.filterNull( strClassType )%>"><input
						type="radio" id="user<%=JspHelper.filterNull( i )%>"
						name="checkuser" <%=JspHelper.filterNull( strIsDisabled )%>
						value=<%=JspHelper.filterNull( userMap.get("userid") )%>
						class="checkbox" <%=JspHelper.filterNull( strIsChecked )%>></td>
					<td width="16%" class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( userMap.get("userid") )%></td>
					<td width="10%" class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( userMap.get("oldparentuserid") )%></td>
					<td width="14%" class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%= JspHelper.filterNull(userMap.get("newparentuserid")) %></td>
					<td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( userMap.get("maker") )%></td>
					<td width="15%" class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( userMap.get("executetimern") )%></td>
				</tr>
			</logic:iterate>

			<% //--------------------------------------  default value --%>
			<input type="hidden" name="userid"
				value="<%=JspHelper.filterNull( nDefaultUserId )%>">

			<% //--------------------------------------  flipping page --%>
			<%@ include file="/inc/SummaryAction.inc"%>
		</table>
		</td>
	</tr>
</table>
</form>
</body>
</html>


